from src.constant import project_root_path


def csv_entrance(config):
    import os
    path = input(f"[统计csv总量]请输入目录(当前{project_root_path}):")
    total_lines = 0
    for root, dirs, files in os.walk(path):
        for file in files:
            if file.endswith('.csv'):
                with open(os.path.join(root, file), 'r', encoding='utf-8') as f:
                    total_lines += sum(1 for _ in f)

    print(f"[统计csv总量]csv数量:{total_lines}")
